<template>
  <div>
  <el-tag>跟进列表</el-tag>
    <div  v-for="item in dataList">
      <el-row>
        <el-col :span="8"><span>操作人</span></el-col>
        <el-col :span="16"><span>{{ item.operName }}</span></el-col>
      </el-row>
      <el-row>
        <el-col :span="8"><span>操作时间</span></el-col>
        <el-col :span="16"><span>{{ item.operTime }}</span></el-col>
      </el-row>
      <el-row v-if="item.record">
        <el-col :span="8"><span>详情</span></el-col>
        <el-col :span="16"><span>{{item.record}}</span></el-col>
      </el-row>
      <el-row v-if="item.reason">
        <el-col :span="8"><span>原因</span></el-col>
        <el-col :span="16"><span>{{item.reason}}</span></el-col>
      </el-row>
      <el-row v-if="item.remark">
        <el-col :span="8"><span>详情</span></el-col>
        <el-col :span="16"><span>{{item.remark}}</span></el-col>
      </el-row>
      <hr>
    </div>
  </div>
</template>

<script>
import { list } from '@/api/monitor/operlog';
import { listTrackLog } from '@/api/crm/trackLog';
export default {
  name: "track-list",
  props: {
    search:{
      type:String,
      default: '商机'
    },
    id:{
      type:[Number,String],
      default: 0
    },
  },
  data(){
    return{
      dataList: [],
    }
  },
  created() {
    this.getList();
  },
  methods:{
    getList(){
      // list({title: '线索跟踪记录'}).then(res => {
      //   this.dataList = this.parseDate(res.rows);
      // })
      listTrackLog({id: this.id,table: this.search}).then(res => {
        this.dataList = res.rows
      })
    },
    // parseDate(result){
    //   let list=[];
    //   if(result && result.length > 0){
    //     for(let item of result){
    //       let operParam = JSON.parse(item.operParam);
    //       console.log(operParam);
    //       if(operParam.id == this.id){
    //         item.operParam = operParam;
    //         list.push(item);
    //       }
    //     }
    //   }
    //   return list;
    // }
  }
}
</script>

<style scoped>

</style>
